﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace CodeTemplate
{
    static class Program
    {
        public static string updateFilePath = Application.StartupPath + "\\" + "AutoUpdate.exe";
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //UpdatePro();


            try
            {

                Application.Run(new FrmMain());
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法正常连接后台，请检查后台应用是否正常！" + ex.Message);
            }
        }

        /// <summary>
        /// 更新程序
        /// </summary>
        private static void UpdatePro()
        {
            iBing.AutoUpdate.UpdateManager updateManager = new iBing.AutoUpdate.UpdateManager();
            if (updateManager.ProgramNeedToUpdate())
            {
                System.Diagnostics.Process.Start(updateFilePath);
                Environment.Exit(0);

            }
        }
    }
}
